//
//  HHYoukuMenuView.m
//
//  Created by lizhiwei on 12-3-12.
//  Copyright (c) 2012年  All rights reserved.
//

#import "HHYoukuMenuView.h"
#import <QuartzCore/QuartzCore.h>
#import "CompanyIntroductionViewController.h"
#import "AppDelegate.h"
#import "ContactCustomerServiceViewController.h"
#import "RegisterViewController.h"
#import "SkinSettingViewController.h"
#import "CarSettingRootViewController.h"
#import "ServiceRemindRootViewController.h"
#import "FeedbackViewController.h"
#import "SystemSetRootViewController.h"
#import "SoftUpdateRootViewController.h"
#import "ManagerSettingRootViewController.h"
#import "RecommendRootViewController.h"
#import "PreferentialInformationViewController.h"
#import "CustomerInformationManageViewController.h"
#import "ServiceEvaluationViewController.h"
#import "TwoDimensionCodeViewController.h"
#import "LoginViewController.h"
#import "SelfhelpReportCaseViewController.h"
#import "ServiceAppointmentViewController.h"
#import "RescueServiceViewController.h"
#import "DesignatedDrivingServiceViewController.h"
#import "SeckillAreaViewController.h"
#import "IntegralRootViewController.h"
#import "InsurancePolicyListViewController.h"
#import "KnowledgeInsuranceViewController.h"
#import "ServiceNoticeRootViewController.h"
#import "ClaimSearchRootViewController.h"
#import "WeatherForecastViewController.h"
#import "NetWorkRootViewController.h"
#import "NetWorkTestViewController.h"
#import "TelephoneCoverViewController.h"
#import "Config.h"
#import "RCAlertViewUtil.h"
#import "NSString+SBJson.h"
#import "ContinueInsuranceRootViewController.h"

#define DEGREES_TO_RADIANS(d) (d * M_PI / 180)
# define IS_IPHONE5 (fabs((double)[[UIScreen mainScreen]bounds].size.height-( double)568)<DBL_EPSILON)


@implementation HHYoukuMenuView
@synthesize rotationView,arrayButtonIcon,bgView,homeView,BtnTag,Moduleid;
@synthesize progress;

- (void)dealloc
{
    [bgView release];
    [homeView release];
    [arrayButtonIcon release];
    [rotationView release];
    [BtnTag release];
    [Moduleid release];
    [progress release];
    [super dealloc];
}

+ (CGRect)getFrame
{
    if (IS_IPHONE5)
    {
        return CGRectMake((320.0 - 296.0)/2.0,548.0 - 148.0 + 14,296.0,148.0);
    }
    else
    {
        return CGRectMake((320.0 - 296.0)/2.0,460.0 - 148.0 + 14,296.0,148.0);
    }
}

+ (CGRect)getHideFrame
{
    if (IS_IPHONE5)
    {
         return CGRectMake((320.0 - 296.0)/2.0,548.0,296.0,148.0);
    }
    else
    {
         return CGRectMake((320.0 - 296.0)/2.0,460.0,296.0,148.0);  
    }
}

- (void)setButtonsFrame
{
        rect[0] =  CGRectMake(247,93,40,40);
        NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:@"公司介绍.png",@"nomal",
                             @"公司介绍.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[1] =  CGRectMake(223,48,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"服务评价.png",@"nomal",
               @"服务评价.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[2] =  CGRectMake(184,17,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"服务预约.png",@"nomal",
               @"服务预约.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[3] =  CGRectMake(130,3,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"客户资料管理.png",@"nomal",
               @"客户资料管理.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[4] =  CGRectMake(72,17,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"联系客服.png",@"nomal",
               @"联系客服.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[5] =  CGRectMake(32,0,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"业务学习.png",@"nomal",
               @"业务学习.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[6] =  CGRectMake(10,93,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"优惠信息.png",@"nomal",
               @"优惠信息.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        //////////////////////////////////////////////////////////////////////////////
        
        rect[7] =  CGRectMake(207,103,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_05.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[8] =  CGRectMake(88,70,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_02.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[9] =  CGRectMake(182,70,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_04.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[10] =  CGRectMake(63,103,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_01.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        ///////////////////////////////////////////////////////////////////////////////
        rect[11] =  CGRectMake(133,55,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_03.png",@"nomal",
               @"22h.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
}

- (void)initView
{
    isClick = FALSE;
    
    bgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"menu1.png"]];
    bgView.frame = CGRectMake(53.0,49.0,191.0, 86.0);
    [self addSubview:bgView];
    [bgView release];
    
    homeView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"cpic.png"]];
    homeView.frame = CGRectMake(96.0,90.0,103.0, 42.0);
    [self addSubview:homeView];
    [homeView release];
    
    rotationView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@""]];
    rotationView.frame = CGRectMake(0.0, 0.0+ 148.0/2.0,296, 148);
    rotationView.backgroundColor = [UIColor clearColor];
    rotationView.userInteractionEnabled = YES;
    rotationView.layer.anchorPoint = CGPointMake(0.5,1.0);
    if (rotationViewIsNomal)
    {
        rotationView.layer.transform = CATransform3DIdentity;
    }
    else
    {
        rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(180),0.0, 0.0, 1.0);;
    }
    [self addSubview:rotationView];
    [rotationView release];
    
    for (int i = 0;i<7;i++)
    {
        NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
        
        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
        button.frame = rect[i];
        if ([dic objectForKey:@"nomal"])
        {
            [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
        }
        if ([dic objectForKey:@"high"])
        {
            [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlStateHighlighted];
        }
        [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
        button.tag = i;
        button.showsTouchWhenHighlighted = YES;
        [rotationView  addSubview:button];
    }
    
    for (int i = 7;i < 12 ;i++)
    {
        NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
        
        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
        button.frame = rect[i];
        if ([dic objectForKey:@"nomal"])
        {
            [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
        }
        if ([dic objectForKey:@"high"])
        {
            [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlStateHighlighted];
        }
        [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
        button.tag = i;
        NSLog(@"--------------%d",button.tag);
        button.showsTouchWhenHighlighted = YES;
        [self  addSubview:button];
    }
}

- (void)meunButtonDown:(id)sender
{
    UIButton *button = (UIButton *)sender;
    self.BtnTag = [NSString stringWithFormat:@"%d",button.tag];
    
    NSLog(@"**************************%@",self.BtnTag);
    
    //用户信息模块
    if (button.tag == 12)
    {
        NSLog(@"userinfodefault%@",[[NSUserDefaults standardUserDefaults] objectForKey:DICT_USER_INFO]);
        NSDictionary *dictUserInfo=[[NSUserDefaults standardUserDefaults] dictionaryForKey:DICT_USER_INFO];
        if (dictUserInfo!=nil) {
            if ([dictUserInfo valueForKey:@"UserAccount"]) {
                NSLog(@"%@",[dictUserInfo valueForKey:@"UserAccount"]);
            }
        }
        else
        {
            [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
            return;
        }

        CustomerInformationManageViewController *customerManageViewCtrl=[[CustomerInformationManageViewController alloc]init];
        [[AppDelegate app].unc pushViewController:customerManageViewCtrl animated:YES];
        [customerManageViewCtrl release];
    }
    
    if (button.tag == 13)
    {
        NSLog(@"userinfodefault%@",[[NSUserDefaults standardUserDefaults] objectForKey:DICT_USER_INFO]);
        NSDictionary *dictUserInfo=[[NSUserDefaults standardUserDefaults] dictionaryForKey:DICT_USER_INFO];
        if (dictUserInfo!=nil) {
            if ([dictUserInfo valueForKey:@"UserAccount"]) {
                NSLog(@"%@",[dictUserInfo valueForKey:@"UserAccount"]);
            }
        }
        else
        {
            [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
            return;
        }

        RecommendRootViewController *recommendRootViewCtrl=[[RecommendRootViewController alloc]init];
        [[AppDelegate app].unc pushViewController:recommendRootViewCtrl animated:YES];
        [recommendRootViewCtrl release];
    }
    
    if (button.tag == 14)
    {
        NSLog(@"userinfodefault%@",[[NSUserDefaults standardUserDefaults] objectForKey:DICT_USER_INFO]);
        NSDictionary *dictUserInfo=[[NSUserDefaults standardUserDefaults] dictionaryForKey:DICT_USER_INFO];
        if (dictUserInfo!=nil) {
            if ([dictUserInfo valueForKey:@"UserAccount"]) {
                NSLog(@"%@",[dictUserInfo valueForKey:@"UserAccount"]);
            }
        }
        else
        {
            [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
            return;
        }

        ManagerSettingRootViewController *managerSettingRootViewCtrl=[[ManagerSettingRootViewController alloc]init];
        [[AppDelegate app].unc pushViewController:managerSettingRootViewCtrl animated:YES];
        [managerSettingRootViewCtrl release];
    }
    
    if (button.tag == 15)
    {
        RegisterViewController *registerViewCtrl=[[RegisterViewController alloc]init];
        [[AppDelegate app].unc pushViewController:registerViewCtrl animated:YES];
        [registerViewCtrl release];
    }
    
    if (button.tag == 16)
    {
        NSDictionary *dictUserInfo=[[NSUserDefaults standardUserDefaults] dictionaryForKey:DICT_USER_INFO];
        if (dictUserInfo!=nil) {
            if ([dictUserInfo valueForKey:@"UserAccount"]) {
                NSLog(@"%@",[dictUserInfo valueForKey:@"UserAccount"]);
            }
            else
            {
                [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
                return;
            }
        }
        else
        {
            [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
            return;
        }
        
        CarSettingRootViewController *carSettingRootViewCtrl=[[CarSettingRootViewController alloc]init];
        [[AppDelegate app].unc pushViewController:carSettingRootViewCtrl animated:YES];
        [carSettingRootViewCtrl release];
    }
    
    if (button.tag == 17)
    {
        LoginViewController *loginViewCtrl=[[LoginViewController alloc]init];
        [[AppDelegate app].unc pushViewController:loginViewCtrl animated:YES];
        [loginViewCtrl release];
    }
    
    if (button.tag == 24)
    {
        NSLog(@"userinfodefault%@",[[NSUserDefaults standardUserDefaults] objectForKey:DICT_USER_INFO]);
        NSDictionary *dictUserInfo=[[NSUserDefaults standardUserDefaults] dictionaryForKey:DICT_USER_INFO];
        if (dictUserInfo!=nil) {
            if ([dictUserInfo valueForKey:@"UserAccount"]) {
                NSLog(@"%@",[dictUserInfo valueForKey:@"UserAccount"]);
            }
        }
        else
        {
            [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
            return;
        }
        
        ContinueInsuranceRootViewController *continueInsuranceViewCtrl=[[ContinueInsuranceRootViewController alloc]init];
        [[AppDelegate app].unc pushViewController:continueInsuranceViewCtrl animated:YES];
        [continueInsuranceViewCtrl release];
        //[self justShowMessage:@"我想续保" title:@"提示!"];
    }
    
    if (button.tag == 25)
    {
        KnowledgeInsuranceViewController *knowledegeInsurance=[[KnowledgeInsuranceViewController alloc]init];
        [[AppDelegate app].unc pushViewController:knowledegeInsurance animated:YES];
        [knowledegeInsurance release];
    }
    
    if (button.tag == 26)
    {
       TelephoneCoverViewController *TelephoneCover =[[TelephoneCoverViewController alloc]init];
        [[AppDelegate app].unc pushViewController:TelephoneCover animated:YES];
        [TelephoneCover release];
    }
    
    if (button.tag == 27)
    {
        NSLog(@"userinfodefault%@",[[NSUserDefaults standardUserDefaults] objectForKey:DICT_USER_INFO]);
        NSDictionary *dictUserInfo=[[NSUserDefaults standardUserDefaults] dictionaryForKey:DICT_USER_INFO];
        if (dictUserInfo!=nil) {
            if ([dictUserInfo valueForKey:@"UserAccount"]) {
                NSLog(@"%@",[dictUserInfo valueForKey:@"UserAccount"]);
            }
        }
        else
        {
            [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
            return;
        }

        SelfhelpReportCaseView = [[SelfhelpReportCaseViewController alloc]init];
        [[AppDelegate app].unc pushViewController:SelfhelpReportCaseView animated:YES];
        [SelfhelpReportCaseView release];
    }
    
    if (button.tag == 28)
    {
        NSDictionary *dictUserInfo=[[NSUserDefaults standardUserDefaults] dictionaryForKey:DICT_USER_INFO];
        if (dictUserInfo!=nil) {
            if ([dictUserInfo valueForKey:@"UserAccount"]) {
                NSLog(@"%@",[dictUserInfo valueForKey:@"UserAccount"]);
            }
            else
            {
                [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
                return;
            }
        }
        else
        {
            [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
            return;
        }
        
        ClaimSearchRootViewController *claimSearchRootViewCtrl=[[ClaimSearchRootViewController alloc]init];
        [[AppDelegate app].unc pushViewController:claimSearchRootViewCtrl animated:YES];
        [claimSearchRootViewCtrl release];
    }
    
    if (button.tag == 29)
    {
        NSDictionary *dictUserInfo=[[NSUserDefaults standardUserDefaults] dictionaryForKey:DICT_USER_INFO];
        if (dictUserInfo!=nil) {
            if ([dictUserInfo valueForKey:@"UserAccount"]) {
                NSLog(@"%@",[dictUserInfo valueForKey:@"UserAccount"]);
            }
        }
        else
        {
            [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
            return;
        }
        
        //Flag =@"1";
        //[self SETCustomerQueryRequest];
        
        InsurancePolicyListView = [[InsurancePolicyListViewController alloc]init];
        [[AppDelegate app].unc pushViewController:InsurancePolicyListView animated:YES];
        [InsurancePolicyListView release];
    }
    
    //客户服务模块
    if (button.tag == 48)
    {
        TwoDimensionCodeView = [[TwoDimensionCodeViewController alloc]init];
        [[AppDelegate app].unc pushViewController:TwoDimensionCodeView animated:YES];
        [TwoDimensionCodeView release];
    }
    
    if (button.tag == 49)
    {
        NSDictionary *dictUserInfo=[[NSUserDefaults standardUserDefaults] dictionaryForKey:DICT_USER_INFO];
        if (dictUserInfo!=nil) {
            if ([dictUserInfo valueForKey:@"UserAccount"]) {
                NSLog(@"%@",[dictUserInfo valueForKey:@"UserAccount"]);
            }
            else
            {
                [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
                return;
            }
        }
        else
        {
            [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
            return;
        }
        
        IntegralRootViewController *integralRootViewCtrl=[[IntegralRootViewController alloc]init];
        [[AppDelegate app].unc pushViewController:integralRootViewCtrl animated:YES];
        [integralRootViewCtrl release];
    }
    
    if (button.tag == 50)
    {
        NSLog(@"userinfodefault%@",[[NSUserDefaults standardUserDefaults] objectForKey:DICT_USER_INFO]);
        NSDictionary *dictUserInfo=[[NSUserDefaults standardUserDefaults] dictionaryForKey:DICT_USER_INFO];
        if (dictUserInfo!=nil) {
            if ([dictUserInfo valueForKey:@"UserAccount"]) {
                NSLog(@"%@",[dictUserInfo valueForKey:@"UserAccount"]);
            }
        }
        else
        {
            [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
            return;
        }

        ServiceEvaluationView = [[ServiceEvaluationViewController alloc]init];
        [[AppDelegate app].unc pushViewController:ServiceEvaluationView animated:YES];
        [ServiceEvaluationView release];
    }
    
    if (button.tag == 51)
    {
        NSDictionary *dictUserInfo=[[NSUserDefaults standardUserDefaults] dictionaryForKey:DICT_USER_INFO];
        if (dictUserInfo!=nil) {
            if ([dictUserInfo valueForKey:@"UserAccount"]) {
                NSLog(@"%@",[dictUserInfo valueForKey:@"UserAccount"]);
            }
            else
            {
                [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
                return;
            }
        }
        else
        {
            [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
            return;
        }
        
        ServiceAppointmentViewController *serviceAppointmentViewCtrl=[[ServiceAppointmentViewController alloc]init];
        [[AppDelegate app].unc pushViewController:serviceAppointmentViewCtrl animated:YES];
        [serviceAppointmentViewCtrl release];
    }
    
    if (button.tag == 52)
    {
        ContactCustomerServiceView = [[ContactCustomerServiceViewController alloc]init];
        [[AppDelegate app].unc pushViewController:ContactCustomerServiceView animated:YES];
        [ContactCustomerServiceView release];
    }
    
    if (button.tag == 53)
    {
        PreferentialInformationViewController *Preferentialinformation = [[PreferentialInformationViewController alloc]init];
        [[AppDelegate app].unc pushViewController:Preferentialinformation animated:YES];
        [Preferentialinformation release];
    }
    
    if (button.tag == 54)
    {
        Companyintroductionview = [[CompanyIntroductionViewController alloc]init];
        [[AppDelegate app].unc pushViewController:Companyintroductionview animated:YES];
        [Companyintroductionview release];
    }
    
    //增值服务模块
    if (button.tag == 60)
    {
        NSLog(@"userinfodefault%@",[[NSUserDefaults standardUserDefaults] objectForKey:DICT_USER_INFO]);
        NSDictionary *dictUserInfo=[[NSUserDefaults standardUserDefaults] dictionaryForKey:DICT_USER_INFO];
        if (dictUserInfo!=nil) {
            if ([dictUserInfo valueForKey:@"UserAccount"]) {
                NSLog(@"%@",[dictUserInfo valueForKey:@"UserAccount"]);
            }
        }
        else
        {
            [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
            return;
        }
        
        //Flag = @"0";
        //[self SETCustomerQueryRequest];
        SeckillAreaView = [[SeckillAreaViewController alloc]init];
        [[AppDelegate app].unc pushViewController:SeckillAreaView animated:YES];
        [SeckillAreaView release];
    }
    
    if (button.tag == 61)
    {
      [self justShowMessage:@"服务代办" title:@"提示!"];
    }
    
    if (button.tag == 62)
    {
        NSLog(@"userinfodefault%@",[[NSUserDefaults standardUserDefaults] objectForKey:DICT_USER_INFO]);
        NSDictionary *dictUserInfo=[[NSUserDefaults standardUserDefaults] dictionaryForKey:DICT_USER_INFO];
        if (dictUserInfo!=nil) {
            if ([dictUserInfo valueForKey:@"UserAccount"]) {
                NSLog(@"%@",[dictUserInfo valueForKey:@"UserAccount"]);
            }
        }
        else
        {
            [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
            return;
        }

        DesignatedDrivingServiceView = [[DesignatedDrivingServiceViewController alloc]init];
        [[AppDelegate app].unc pushViewController:DesignatedDrivingServiceView animated:YES];
        [DesignatedDrivingServiceView release];
    }
    
    if (button.tag == 63)
    {
        WeatherForecastView = [[WeatherForecastViewController alloc]init];
        [[AppDelegate app].unc pushViewController:WeatherForecastView animated:YES];
        [WeatherForecastView release];
    }
    
    if (button.tag == 64)
    {
        NSDictionary *dictUserInfo=[[NSUserDefaults standardUserDefaults] dictionaryForKey:DICT_USER_INFO];
        if (dictUserInfo!=nil) {
            if ([dictUserInfo valueForKey:@"UserAccount"]) {
                NSLog(@"%@",[dictUserInfo valueForKey:@"UserAccount"]);
            }
            else
            {
                [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
                return;
            }
        }
        else
        {
            [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
            return;
        }
        
        
        ServiceNoticeRootViewController *serviceNoticeRootViewCtrl=[[ServiceNoticeRootViewController alloc]init];
        [[AppDelegate app].unc pushViewController:serviceNoticeRootViewCtrl animated:YES];
        [serviceNoticeRootViewCtrl release];
    }
    
    if (button.tag == 65)
    {
//        NetWorkRootViewController *netWorkRootViewCtrl=[[NetWorkRootViewController alloc]init];
//        [[AppDelegate app].unc pushViewController:netWorkRootViewCtrl animated:YES];
//        [netWorkRootViewCtrl release];
        NetWorkTestViewController *netTestViewCtrl=[[NetWorkTestViewController alloc]init];
        [[AppDelegate app].unc pushViewController:netTestViewCtrl animated:YES];
        [netTestViewCtrl release];
    }
    
    if (button.tag == 66)
    {
        NSLog(@"userinfodefault%@",[[NSUserDefaults standardUserDefaults] objectForKey:DICT_USER_INFO]);
        NSDictionary *dictUserInfo=[[NSUserDefaults standardUserDefaults] dictionaryForKey:DICT_USER_INFO];
        if (dictUserInfo!=nil) {
            if ([dictUserInfo valueForKey:@"UserAccount"]) {
                NSLog(@"%@",[dictUserInfo valueForKey:@"UserAccount"]);
            }
        }
        else
        {
            [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
            return;
        }

        RescueServiceView = [[RescueServiceViewController alloc]init];
        [[AppDelegate app].unc pushViewController:RescueServiceView animated:YES];
        [RescueServiceView release];
    }
    
    //系统设置模块
    if (button.tag == 36)
    {
        NSUserDefaults * USERDefault = [NSUserDefaults standardUserDefaults];
        [USERDefault setObject:@"0" forKey:@"skinset"];
        SkinSettingViewController *skinSettingViewCtrl=[[SkinSettingViewController alloc]init];
        [[AppDelegate app].unc pushViewController:skinSettingViewCtrl animated:YES];
        [skinSettingViewCtrl release];
    }
    
    if (button.tag == 37)
    {
        SoftUpdateRootViewController *softUpdateRootViewCtrl=[[SoftUpdateRootViewController alloc]init];
        [[AppDelegate app].unc pushViewController:softUpdateRootViewCtrl animated:YES];
        [softUpdateRootViewCtrl release];
    }
    
    if (button.tag == 38)
    {
        NSUserDefaults * USERDefault = [NSUserDefaults standardUserDefaults];
        [USERDefault setObject:@"1" forKey:@"skinset"];
        
        SystemSetRootViewController *systemSetRootViewCtrl=[[SystemSetRootViewController alloc]init];
        [[AppDelegate app].unc pushViewController:systemSetRootViewCtrl animated:YES];
        [systemSetRootViewCtrl release];
    }
    
    if (button.tag == 39)
    {
        NSDictionary *dictUserInfo=[[NSUserDefaults standardUserDefaults] dictionaryForKey:DICT_USER_INFO];
        if (dictUserInfo!=nil) 
        {
            if ([dictUserInfo valueForKey:@"UserAccount"]) 
            {
                NSLog(@"%@",[dictUserInfo valueForKey:@"UserAccount"]);
            }
        }
        else
        {
        }

        FeedbackViewController *feedbackViewCtrl=[[FeedbackViewController alloc]init];
        [[AppDelegate app].unc pushViewController:feedbackViewCtrl animated:YES];
        [feedbackViewCtrl release];
    }
    
    if (button.tag == 40)
    {
        NSDictionary *dictUserInfo=[[NSUserDefaults standardUserDefaults] dictionaryForKey:DICT_USER_INFO];
        if (dictUserInfo!=nil) {
            if ([dictUserInfo valueForKey:@"UserAccount"]) {
                NSLog(@"%@",[dictUserInfo valueForKey:@"UserAccount"]);
            }
            else
            {
                [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
                return;
            }
        }
        else
        {
            [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
            return;
        }
        
        ServiceRemindRootViewController *serviceRemindRootViewCtrl=[[ServiceRemindRootViewController alloc]init];
        [[AppDelegate app].unc  pushViewController:serviceRemindRootViewCtrl animated:YES];
        [serviceRemindRootViewCtrl release];
    }

    isClick=FALSE;
    
    if (button.tag == 7) 
    {
        //设置模块ID
        
        button.userInteractionEnabled = NO;
        
        self.Moduleid = @"001";
        [self getModuleid];
        
        if (isClick == FALSE) //弹出
        {
            //[button setImage:[UIImage imageNamed:@"22a.png"] forState:UIControlStateNormal];
            isClick = TRUE;
            
//            UIButton *menuButton1 =  (UIButton *)[self viewWithTag:11];
//            [menuButton1 setEnabled:NO];
//            
//            UIButton *menuButton2 =  (UIButton *)[self viewWithTag:10];
//            [menuButton2 setEnabled:NO];
//            
//            UIButton *menuButton3 =  (UIButton *)[self viewWithTag:9];
//            [menuButton3 setEnabled:NO];
//            
//            UIButton *menuButton4 =  (UIButton *)[self viewWithTag:8];
//            [menuButton4 setEnabled:NO];
          
        }
        else     //收起
        {
            [arrayButtonIcon removeAllObjects];
            
            rect[0] =  CGRectMake(247,83,40,40);
            NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:@"客户资料管理.png",@"nomal",
                                 @"客户资料管理.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[1] =  CGRectMake(213,40,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Usr_05.png",@"nomal",
                   @"Usr_05.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[2] =  CGRectMake(164,11,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Usr_04.png",@"nomal",
                   @"Usr_04.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[3] =  CGRectMake(100,11,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Usr_03.png",@"nomal",
                   @"Usr_03.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[4] =  CGRectMake(48,40,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Usr_02.png",@"nomal",
                   @"Usr_02.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[5] =  CGRectMake(12,83,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Usr_01.png",@"nomal",
                   @"Usr_01.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[6] =  CGRectMake(10,93,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"优惠信息.png",@"nomal",
                   @"优惠信息.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            //////////////////////////////////////////////////////////////////////////////
            
            rect[7] =  CGRectMake(207,103,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_05.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[8] =  CGRectMake(88,70,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_02.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[9] =  CGRectMake(182,70,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_04.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[10] =  CGRectMake(63,103,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_01.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            ///////////////////////////////////////////////////////////////////////////////
            rect[11] =  CGRectMake(135,55,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_03.png",@"nomal",
                   @"22a.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            if([self.subviews count] > 0)
            {
                for (UIView *subview in self.subviews) 
                {
                    [subview removeFromSuperview];
                }
            }
            
            bgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"menu1.png"]];
            bgView.frame = CGRectMake(53.0,49.0,191.0, 86.0);
            [self addSubview:bgView];
            [bgView release];
            
            homeView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"cpic.png"]];
            homeView.frame = CGRectMake(96.0,90.0,103.0, 42.0);
            [self addSubview:homeView];
            [homeView release];
            
            rotationView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@""]];
            rotationView.frame = CGRectMake(0.0, 0.0+ 148.0/2.0,296, 148);
            rotationView.backgroundColor = [UIColor clearColor];
            rotationView.userInteractionEnabled = YES;
            rotationView.layer.anchorPoint = CGPointMake(0.5,1.0);
            if (rotationViewIsNomal)
            {
                rotationView.layer.transform = CATransform3DIdentity;
            }
            else
            {
                rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(180),0.0, 0.0, 1.0);;
            }
            [self addSubview:rotationView];
            [rotationView release];
            
            for (int i = 0;i<7;i++)
            {
                NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
                
                UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
                button.frame = rect[i];
                if ([dic objectForKey:@"nomal"])
                {
                    [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
                }
                if ([dic objectForKey:@"high"])
                {
                    [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlStateHighlighted];
                }
                [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
                button.tag = (12+i);
                button.showsTouchWhenHighlighted = YES;
                if (i!=6)
                {
                    [rotationView addSubview:button];
                }
            }
            
            for (int i = 7;i < 12 ;i++ )
            {
                NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
                
                UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
                button.frame = rect[i];
                if ([dic objectForKey:@"nomal"])
                {
                    [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
                }
                if ([dic objectForKey:@"high"])
                {
                    [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlEventTouchUpInside];
                }
                [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
                button.tag = i;
                button.showsTouchWhenHighlighted = YES;
                [self  addSubview:button];
            }

            isClick = FALSE;
            
//            UIButton *menuButton1 =  (UIButton *)[self viewWithTag:11];
//            [menuButton1 setEnabled:YES];
//            
//            UIButton *menuButton2 =  (UIButton *)[self viewWithTag:10];
//            [menuButton2 setEnabled:YES];
//            
//            UIButton *menuButton3 =  (UIButton *)[self viewWithTag:9];
//            [menuButton3 setEnabled:YES];
//            
//            UIButton *menuButton4 =  (UIButton *)[self viewWithTag:8];
//            [menuButton4 setEnabled:YES];
        }
    
        [UIView beginAnimations:@"present-countdown" context:nil];
        [UIView setAnimationDuration:0.1];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
        [UIView setAnimationDidStopSelector:@selector(rotationAnimationStop2)];
        CGFloat angle = rotationViewIsNomal ? 180.0:0.0;
        rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(angle),0.0, 0.0, 1.0);
        [UIView commitAnimations];
        
        [UIView beginAnimations:@"present-countdown" context:nil];
        [UIView setAnimationDuration:0.1];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
        [UIView setAnimationDidStopSelector:@selector(rotationAnimationStop2)];
        CGFloat angle222 = rotationViewIsNomal ? 180.0:0.0;
        rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(angle222),0.0, 0.0, 1.0);
        [UIView commitAnimations];
    }
    if (button.tag == 8)
    {
        
        //设置模块ID
        self.Moduleid = @"002";
        [self getModuleid];
        if (isClick == FALSE) 
        {
            //[button setImage:[UIImage imageNamed:@"22a.png"] forState:UIControlStateNormal];
            isClick = TRUE;
            
//            UIButton *menuButton1 =  (UIButton *)[self viewWithTag:11];
//            [menuButton1 setEnabled:NO];
//            
//            UIButton *menuButton2 =  (UIButton *)[self viewWithTag:10];
//            [menuButton2 setEnabled:NO];
//            
//            UIButton *menuButton3 =  (UIButton *)[self viewWithTag:9];
//            [menuButton3 setEnabled:NO];
//            
//            UIButton *menuButton4 =  (UIButton *)[self viewWithTag:7];
//            [menuButton4 setEnabled:NO];

        }
        else
        {
            isClick = FALSE;
            [arrayButtonIcon removeAllObjects];
            
            rect[0] =  CGRectMake(247,83,40,40);
            NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Ins_06.png",@"nomal",
                                 @"Ins_06.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[1] =  CGRectMake(213,40,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Ins_05.png",@"nomal",
                   @"Ins_05.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[2] =  CGRectMake(164,11,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"电话投保.png",@"nomal",
                   @"电话投保.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[3] =  CGRectMake(100,11,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Ins_03.png",@"nomal",
                   @"Ins_03.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[4] =  CGRectMake(48,40,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Ins_02.png",@"nomal",
                   @"Ins_02.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[5] =  CGRectMake(12,83,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Ins_01.png",@"nomal",
                   @"Ins_01.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[6] =  CGRectMake(10,93,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"优惠信息.png",@"nomal",
                   @"优惠信息.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            //////////////////////////////////////////////////////////////////////////////
            
            rect[7] =  CGRectMake(207,103,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_05.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[8] =  CGRectMake(88,70,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_02.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[9] =  CGRectMake(182,70,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_04.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[10] =  CGRectMake(63,103,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_01.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            ///////////////////////////////////////////////////////////////////////////////
            rect[11] =  CGRectMake(135,55,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_03.png",@"nomal",
                   @"22a.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            if([self.subviews count] > 0)
            {
                for (UIView *subview in self.subviews) 
                {
                    [subview removeFromSuperview];
                }
            }
            
            bgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"menu1.png"]];
            bgView.frame = CGRectMake(53.0,49.0,191.0, 86.0);
            [self addSubview:bgView];
            [bgView release];
            
            homeView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"cpic.png"]];
            homeView.frame = CGRectMake(96.0,90.0,103.0, 42.0);
            [self addSubview:homeView];
            [homeView release];
            
            rotationView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@""]];
            rotationView.frame = CGRectMake(0.0, 0.0+ 148.0/2.0,296, 148);
            rotationView.backgroundColor = [UIColor clearColor];
            rotationView.userInteractionEnabled = YES;
            rotationView.layer.anchorPoint = CGPointMake(0.5,1.0);
            if (rotationViewIsNomal)
            {
                rotationView.layer.transform = CATransform3DIdentity;
            }
            else
            {
                rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(180),0.0, 0.0, 1.0);;
            }
            [self addSubview:rotationView];
            [rotationView release];
            
            for (int i = 0;i<7;i++)
            {
                NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
                
                UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
                button.frame = rect[i];
                if ([dic objectForKey:@"nomal"])
                {
                    [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
                }
                if ([dic objectForKey:@"high"])
                {
                    [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlStateHighlighted];
                }
                [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
                button.tag = (24+i);
                button.showsTouchWhenHighlighted = YES;
                if (i!=6)
                {
                    [rotationView addSubview:button];
                }
            }
            
            for (int i = 7;i < 12 ;i++ )
            {
                NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
                
                UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
                button.frame = rect[i];
                if ([dic objectForKey:@"nomal"])
                {
                    [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
                }
                if ([dic objectForKey:@"high"])
                {
                    [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlEventTouchUpInside];
                }
                [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
                button.tag = i;
                button.showsTouchWhenHighlighted = YES;
                [self  addSubview:button];
            }

//            UIButton *menuButton1 =  (UIButton *)[self viewWithTag:11];
//            [menuButton1 setEnabled:YES];
//            
//            UIButton *menuButton2 =  (UIButton *)[self viewWithTag:10];
//            [menuButton2 setEnabled:YES];
//            
//            UIButton *menuButton3 =  (UIButton *)[self viewWithTag:9];
//            [menuButton3 setEnabled:YES];
//            
//            UIButton *menuButton4 =  (UIButton *)[self viewWithTag:7];
//            [menuButton4 setEnabled:YES];
        }
        
        //button.userInteractionEnabled = NO;
        [UIView beginAnimations:@"present-countdown" context:nil];
        [UIView setAnimationDuration:0.1];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
        [UIView setAnimationDidStopSelector:@selector(rotationAnimationStop)];
        CGFloat angle = rotationViewIsNomal ? 180.0:0.0;
        rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(angle),0.0, 0.0, 1.0);
        [UIView commitAnimations];
        
        [UIView beginAnimations:@"present-countdown" context:nil];
        [UIView setAnimationDuration:0.1];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
        [UIView setAnimationDidStopSelector:@selector(rotationAnimationStop)];
        CGFloat angle222 = rotationViewIsNomal ? 180.0:0.0;
        rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(angle222),0.0, 0.0, 1.0);
        [UIView commitAnimations];
    }
    
    if (button.tag == 9)
    {
        
        //设置模块ID
        self.Moduleid = @"003";
        [self getModuleid];
        if (isClick == FALSE) 
        {
            //[button setImage:[UIImage imageNamed:@"22a.png"] forState:UIControlStateNormal];
            isClick = TRUE;
//            UIButton *menuButton1 =  (UIButton *)[self viewWithTag:11];
//            [menuButton1 setEnabled:NO];
//            
//            UIButton *menuButton2 =  (UIButton *)[self viewWithTag:10];
//            [menuButton2 setEnabled:NO];
//            
//            UIButton *menuButton3 =  (UIButton *)[self viewWithTag:8];
//            [menuButton3 setEnabled:NO];
//            
//            UIButton *menuButton4 =  (UIButton *)[self viewWithTag:7];
//            [menuButton4 setEnabled:NO];
        }
        else
        {
            [arrayButtonIcon removeAllObjects];
            
            rect[5] =  CGRectMake(247,93,40,40);
            NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Sys_01.png",@"nomal",
                                 @"Sys_01.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[1] =  CGRectMake(223,48,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Sys_05.png",@"nomal",
                   @"Sys_05.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[2] =  CGRectMake(184,17,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Sys_04.png",@"nomal",
                   @"Sys_04.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[3] =  CGRectMake(130,3,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Sys_03.png",@"nomal",
                   @"Sys_03.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[4] =  CGRectMake(72,17,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Sys_02.png",@"nomal",
                   @"Sys_02.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[0] =  CGRectMake(32,48,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Sys_01.png",@"nomal",
                   @"Sys_01.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[6] =  CGRectMake(10,93,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"优惠信息.png",@"nomal",
                   @"优惠信息.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            //////////////////////////////////////////////////////////////////////////////
            
            rect[7] =  CGRectMake(207,103,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_05.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[8] =  CGRectMake(88,70,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_02.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[9] =  CGRectMake(182,70,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_04.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[10] =  CGRectMake(63,103,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_01.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            ///////////////////////////////////////////////////////////////////////////////
            rect[11] =  CGRectMake(135,55,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_03.png",@"nomal",
                   @"22a.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            if([self.subviews count] > 0)
            {
                for (UIView *subview in self.subviews) 
                {
                    [subview removeFromSuperview];
                }
            }
            
            bgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"menu1.png"]];
            bgView.frame = CGRectMake(53.0,49.0,191.0, 86.0);
            [self addSubview:bgView];
            [bgView release];
            
            homeView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"cpic.png"]];
            homeView.frame = CGRectMake(96.0,90.0,103.0, 42.0);
            [self addSubview:homeView];
            [homeView release];
            
            rotationView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@""]];
            rotationView.frame = CGRectMake(0.0, 0.0+ 148.0/2.0,296, 148);
            rotationView.backgroundColor = [UIColor clearColor];
            rotationView.userInteractionEnabled = YES;
            rotationView.layer.anchorPoint = CGPointMake(0.5,1.0);
            if (rotationViewIsNomal)
            {
                rotationView.layer.transform = CATransform3DIdentity;
            }
            else
            {
                rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(180),0.0, 0.0, 1.0);;
            }
            [self addSubview:rotationView];
            [rotationView release];
            
            for (int i = 0;i<7;i++)
            {
                NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
                
                UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
                button.frame = rect[i];
                if ([dic objectForKey:@"nomal"])
                {
                    [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
                }
                if ([dic objectForKey:@"high"])
                {
                    [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlStateHighlighted];
                }
                [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
                button.tag = (36+i);
                button.showsTouchWhenHighlighted = YES;
                if (i==0 || i==1|| i==2|| i==3|| i==4 ) 
                {
                    [rotationView  addSubview:button];
                }
            }
            
            for (int i = 7;i < 12 ;i++ )
            {
                NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
                
                UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
                button.frame = rect[i];
                if ([dic objectForKey:@"nomal"])
                {
                    [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
                }
                if ([dic objectForKey:@"high"])
                {
                    [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlEventTouchUpInside];
                }
                [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
                button.tag = i;
                button.showsTouchWhenHighlighted = YES;
                [self  addSubview:button];
            }
            
            isClick = FALSE;
//            UIButton *menuButton1 =  (UIButton *)[self viewWithTag:11];
//            [menuButton1 setEnabled:YES];
//            
//            UIButton *menuButton2 =  (UIButton *)[self viewWithTag:10];
//            [menuButton2 setEnabled:YES];
//            
//            UIButton *menuButton3 =  (UIButton *)[self viewWithTag:8];
//            [menuButton3 setEnabled:YES];
//            
//            UIButton *menuButton4 =  (UIButton *)[self viewWithTag:7];
//            [menuButton4 setEnabled:YES];
        }
        
        //button.userInteractionEnabled = NO;
        [UIView beginAnimations:@"present-countdown" context:nil];
        [UIView setAnimationDuration:0.1];
        [UIView setAnimationDelegate:self];
        //[UIView setanimationRepeatCount:0.0];
        [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
        [UIView setAnimationDidStopSelector:@selector(rotationAnimationStop3)];
        CGFloat angle = rotationViewIsNomal ? 180.0:0.0;
        rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(angle),0.0, 0.0, 1.0);
        [UIView commitAnimations];
        
        [UIView beginAnimations:@"present-countdown" context:nil];
        [UIView setAnimationDuration:0.1];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
        [UIView setAnimationDidStopSelector:@selector(rotationAnimationStop3)];
        CGFloat angle222 = rotationViewIsNomal ? 180.0:0.0;
        rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(angle222),0.0, 0.0, 1.0);
        [UIView commitAnimations];
    }
    
    if (button.tag == 10)
    {
        
        //设置模块ID
        self.Moduleid = @"004";
        [self getModuleid];
        if (isClick == FALSE) 
        {
            //[button setImage:[UIImage imageNamed:@"22a.png"] forState:UIControlStateNormal];
            isClick = TRUE;
            
//            UIButton *menuButton1 =  (UIButton *)[self viewWithTag:11];
//            [menuButton1 setEnabled:NO];
//                
//            UIButton *menuButton2 =  (UIButton *)[self viewWithTag:9];
//            [menuButton2 setEnabled:NO];
//                
//            UIButton *menuButton3 =  (UIButton *)[self viewWithTag:8];
//            [menuButton3 setEnabled:NO];
//                
//            UIButton *menuButton4 =  (UIButton *)[self viewWithTag:7];
//            [menuButton4 setEnabled:NO];
        }
        else
        {
            [arrayButtonIcon removeAllObjects];
            
            rect[0] =  CGRectMake(247,93,40,40);
            NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Cus_02.png",@"nomal",
                                 @"Cus_02.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[1] =  CGRectMake(223,48,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Cus_01.png",@"nomal",
                   @"Cus_01.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[2] =  CGRectMake(184,17,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"服务评价.png",@"nomal",
                   @"服务评价.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[3] =  CGRectMake(130,3,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"服务预约.png",@"nomal",
                   @"服务预约.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[4] =  CGRectMake(72,17,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"联系客服.png",@"nomal",
                   @"联系客服.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[5] =  CGRectMake(32,48,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"优惠信息.png",@"nomal",
                   @"优惠信息.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[6] =  CGRectMake(10,93,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"公司介绍.png",@"nomal",
                   @"公司介绍.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            //////////////////////////////////////////////////////////////////////////////
            
            rect[7] =  CGRectMake(207,103,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_05.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[8] =  CGRectMake(88,70,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_02.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[9] =  CGRectMake(182,70,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_04.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[10] =  CGRectMake(63,103,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_01.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            ///////////////////////////////////////////////////////////////////////////////
            rect[11] =  CGRectMake(135,55,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_03.png",@"nomal",
                   @"22a.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            if([self.subviews count] > 0)
            {
                for (UIView *subview in self.subviews) 
                {
                    [subview removeFromSuperview];
                }
            }
            
            bgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"menu1.png"]];
            bgView.frame = CGRectMake(53.0,49.0,191.0, 86.0);
            [self addSubview:bgView];
            [bgView release];
            
            homeView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"cpic.png"]];
            homeView.frame = CGRectMake(96.0,90.0,103.0, 42.0);
            [self addSubview:homeView];
            [homeView release];
            
            rotationView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@""]];
            rotationView.frame = CGRectMake(0.0, 0.0+ 148.0/2.0,296, 148);
            rotationView.backgroundColor = [UIColor clearColor];
            rotationView.userInteractionEnabled = YES;
            rotationView.layer.anchorPoint = CGPointMake(0.5,1.0);
            if (rotationViewIsNomal)
            {
                rotationView.layer.transform = CATransform3DIdentity;
            }
            else
            {
                rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(180),0.0, 0.0, 1.0);;
            }
            [self addSubview:rotationView];
            [rotationView release];
            
            for (int i = 0;i<7;i++)
            {
                NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
                
                UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
                button.frame = rect[i];
                if ([dic objectForKey:@"nomal"])
                {
                    [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
                }
                if ([dic objectForKey:@"high"])
                {
                    [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlStateHighlighted];
                }
                [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
                button.tag = (48+i);
                button.showsTouchWhenHighlighted = YES;
                [rotationView  addSubview:button];
            }
            
            for (int i = 7;i < 12 ;i++ )
            {
                NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
                
                UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
                button.frame = rect[i];
                if ([dic objectForKey:@"nomal"])
                {
                    [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
                }
                if ([dic objectForKey:@"high"])
                {
                    [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlEventTouchUpInside];
                }
                [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
                button.tag = i;
                button.showsTouchWhenHighlighted = YES;
                [self  addSubview:button];
            }
            isClick = FALSE;
            
//            UIButton *menuButton1 =  (UIButton *)[self viewWithTag:11];
//            [menuButton1 setEnabled:YES];
//                
//            UIButton *menuButton2 =  (UIButton *)[self viewWithTag:9];
//            [menuButton2 setEnabled:YES];
//                
//            UIButton *menuButton3 =  (UIButton *)[self viewWithTag:8];
//            [menuButton3 setEnabled:YES];
//                
//            UIButton *menuButton4 =  (UIButton *)[self viewWithTag:7];
//            [menuButton4 setEnabled:YES];
            
        }
        
        //button.userInteractionEnabled = NO;
        [UIView beginAnimations:@"present-countdown" context:nil];
        [UIView setAnimationDuration:0.1];
        [UIView setAnimationDelegate:self];
        //[UIView setAnimationRepeatCount:0.0];
        [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
        [UIView setAnimationDidStopSelector:@selector(rotationAnimationStop4)];
        CGFloat angle = rotationViewIsNomal ? 180.0:0.0;
        rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(angle),0.0, 0.0, 1.0);
        [UIView commitAnimations];
        
        [UIView beginAnimations:@"present-countdown" context:nil];
        [UIView setAnimationDuration:0.1];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
        [UIView setAnimationDidStopSelector:@selector(rotationAnimationStop4)];
        CGFloat angle222 = rotationViewIsNomal ? 180.0:0.0;
        rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(angle222),0.0, 0.0, 1.0);
        [UIView commitAnimations];
    }
    
    if (button.tag == 11)
    {
        UIButton *menuButton1 =  (UIButton *)[self viewWithTag:11];
        [menuButton1 setEnabled:NO];
        
        //设置模块ID
        self.Moduleid = @"005";
        [self getModuleid];
        if (isClick == FALSE) 
        {
            //[button setImage:[UIImage imageNamed:@"22a.png"] forState:UIControlStateNormal];
            isClick = TRUE;
//            UIButton *menuButton1 =  (UIButton *)[self viewWithTag:10];
//            [menuButton1 setEnabled:NO];
//            
//            UIButton *menuButton2 =  (UIButton *)[self viewWithTag:9];
//            [menuButton2 setEnabled:NO];
//            
//            UIButton *menuButton3 =  (UIButton *)[self viewWithTag:8];
//            [menuButton3 setEnabled:NO];
//            
//            UIButton *menuButton4 =  (UIButton *)[self viewWithTag:7];
//            [menuButton4 setEnabled:NO];
        }
        else
        {
            [arrayButtonIcon removeAllObjects];
            
            rect[0] =  CGRectMake(247,93,40,40);
            NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Val_07.png",@"nomal",
                                 @"Val_07.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[1] =  CGRectMake(223,48,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Val_06.png",@"nomal",
                   @"Val_06.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[2] =  CGRectMake(184,17,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Val_05.png",@"nomal",
                   @"Val_05.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[3] =  CGRectMake(130,3,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Val_04.png",@"nomal",
                   @"Val_04.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[4] =  CGRectMake(72,17,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Val_03.png",@"nomal",
                   @"Val_03.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[5] =  CGRectMake(32,48,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Val_02.png",@"nomal",
                   @"Val_02.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[6] =  CGRectMake(10,93,40,40);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Val_01.png",@"nomal",
                   @"Val_01.png",@"high",nil];
            [arrayButtonIcon addObject:dic];
            
            //////////////////////////////////////////////////////////////////////////////
            
            rect[7] =  CGRectMake(207,103,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_05.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[8] =  CGRectMake(88,70,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_02.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[9] =  CGRectMake(182,70,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_04.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            rect[10] =  CGRectMake(63,103,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_01.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            ///////////////////////////////////////////////////////////////////////////////
            rect[11] =  CGRectMake(135,55,25,25);
            dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_03.png",@"nomal",nil];
            [arrayButtonIcon addObject:dic];
            
            if([self.subviews count] > 0)
            {
                for (UIView *subview in self.subviews) 
                {
                    [subview removeFromSuperview];
                }
            }
            
            bgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"menu1.png"]];
            bgView.frame = CGRectMake(53.0,49.0,191.0, 86.0);
            [self addSubview:bgView];
            [bgView release];
            
            homeView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"cpic.png"]];
            homeView.frame = CGRectMake(96.0,90.0,103.0, 42.0);
            [self addSubview:homeView];
            [homeView release];
            
            rotationView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@""]];
            rotationView.frame = CGRectMake(0.0, 0.0+ 148.0/2.0,296, 148);
            rotationView.backgroundColor = [UIColor clearColor];
            rotationView.userInteractionEnabled = YES;
            rotationView.layer.anchorPoint = CGPointMake(0.5,1.0);
            if (rotationViewIsNomal)
            {
                rotationView.layer.transform = CATransform3DIdentity;
            }
            else
            {
                rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(180),0.0, 0.0, 1.0);;
            }
            [self addSubview:rotationView];
            [rotationView release];
            
            for (int i = 0;i<7;i++)
            {
                NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
                
                UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
                button.frame = rect[i];
                if ([dic objectForKey:@"nomal"])
                {
                    [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
                }
                if ([dic objectForKey:@"high"])
                {
                    [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlStateHighlighted];
                }
                [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
                button.tag = (60+i);
                button.showsTouchWhenHighlighted = YES;
                [rotationView  addSubview:button];
            }
            
            for (int i = 7;i < 12 ;i++ )
            {
                NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
                
                UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
                button.frame = rect[i];
                if ([dic objectForKey:@"nomal"])
                {
                    [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
                }
                if ([dic objectForKey:@"high"])
                {
                    [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlEventTouchUpInside];
                }
                [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
                button.tag = i;
                button.showsTouchWhenHighlighted = YES;
                [self  addSubview:button];
            }

            isClick = FALSE;
//            UIButton *menuButton1 =  (UIButton *)[self viewWithTag:10];
//            [menuButton1 setEnabled:YES];
//            
//            UIButton *menuButton2 =  (UIButton *)[self viewWithTag:9];
//            [menuButton2 setEnabled:YES];
//            
//            UIButton *menuButton3 =  (UIButton *)[self viewWithTag:8];
//            [menuButton3 setEnabled:YES];
//            
//            UIButton *menuButton4 =  (UIButton *)[self viewWithTag:7];
//            [menuButton4 setEnabled:YES];
        }

        //button.userInteractionEnabled = NO;
        [UIView beginAnimations:@"present-countdown" context:nil];
        [UIView setAnimationDuration:0.1];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
        [UIView setAnimationDidStopSelector:@selector(rotationAnimationStop1)];
        CGFloat angle = rotationViewIsNomal ? 180.0:0.0;
        rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(angle),0.0, 0.0, 1.0);
        [UIView commitAnimations];
        
        [UIView beginAnimations:@"present-countdown" context:nil];
        [UIView setAnimationDuration:0.1];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
        [UIView setAnimationDidStopSelector:@selector(rotationAnimationStop1)];
        CGFloat angle222 = rotationViewIsNomal ? 180.0:0.0;
        rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(angle222),0.0, 0.0, 1.0);
        [UIView commitAnimations];
    }

}

- (void)rotationAnimationStop
{
    UIButton *menuButton =  (UIButton *)[self viewWithTag:8];
    menuButton.userInteractionEnabled = YES;
    rotationViewIsNomal = !rotationViewIsNomal;
}

- (void)rotationAnimationStop1
{
    UIButton *menuButton =  (UIButton *)[self viewWithTag:11];
    [menuButton setEnabled:YES];
    rotationViewIsNomal = !rotationViewIsNomal;
}

- (void)rotationAnimationStop2
{
    UIButton *menuButton =  (UIButton *)[self viewWithTag:7];
    menuButton.userInteractionEnabled = YES;
    rotationViewIsNomal = !rotationViewIsNomal;
}

- (void)rotationAnimationStop3
{
    UIButton *menuButton =  (UIButton *)[self viewWithTag:9];
    menuButton.userInteractionEnabled = YES;
    rotationViewIsNomal = !rotationViewIsNomal;
}

- (void)rotationAnimationStop4
{
    UIButton *menuButton =  (UIButton *)[self viewWithTag:10];
    menuButton.userInteractionEnabled = YES;
    rotationViewIsNomal = !rotationViewIsNomal;
}

- (void)hideMenuAnimationStop
{
    
}

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) 
    {
        rotationViewIsNomal = NO;
        isMenuHide = NO;
        arrayButtonIcon = [[NSMutableArray alloc]init];
        [self setButtonsFrame];
        [self initView];
    }
    return self;
}

- (void)showOrHideMenu
{
    [UIView beginAnimations:@"present-countdown" context:nil];
    [UIView setAnimationDuration:0.1];
    [UIView setAnimationDelegate:self];
    [UIView setAnimationDidStopSelector:@selector(hideMenuAnimationStop)];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];

    if (!isMenuHide) 
    {
        self.frame = [HHYoukuMenuView getHideFrame];
    }
    else
    {
        self.frame = [HHYoukuMenuView getFrame];
    }
    isMenuHide = !isMenuHide;
    [UIView commitAnimations];
}

- (BOOL)getisMenuHide
{
    return isMenuHide;
}


- (void) getModuleid
{
    if ([self.Moduleid isEqualToString:@"001"])//用户信息
    {
        [arrayButtonIcon removeAllObjects];
        
        rect[0] =  CGRectMake(247,83,40,40);
        NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:@"客户资料管理.png",@"nomal",
                             @"客户资料管理.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[1] =  CGRectMake(213,40,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Usr_05.png",@"nomal",
               @"Usr_05.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[2] =  CGRectMake(164,11,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Usr_04.png",@"nomal",
               @"Usr_04.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[3] =  CGRectMake(100,11,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Usr_03.png",@"nomal",
               @"Usr_03.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[4] =  CGRectMake(48,40,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Usr_02.png",@"nomal",
               @"Usr_02.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[5] =  CGRectMake(12,83,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Usr_01.png",@"nomal",
               @"Usr_01.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[6] =  CGRectMake(10,93,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"优惠信息.png",@"nomal",
               @"优惠信息.png",@"high",nil];
        [arrayButtonIcon addObject:dic];        
        //////////////////////////////////////////////////////////////////////////////
        
        rect[7] =  CGRectMake(207,103,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_5.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[8] =  CGRectMake(88,70,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_02.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[9] =  CGRectMake(182,70,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_04.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[10] =  CGRectMake(63,103,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_01.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        ///////////////////////////////////////////////////////////////////////////////
        rect[11] =  CGRectMake(135,55,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_03.png",@"nomal",
               @"22a.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        if([self.subviews count] > 0)
        {
            for (UIView *subview in self.subviews) 
            {
                [subview removeFromSuperview];
            }
        }
        
        bgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"menu1.png"]];
        bgView.frame = CGRectMake(53.0,49.0,191.0, 86.0);
        [self addSubview:bgView];
        [bgView release];
        
        homeView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"cpic.png"]];
        homeView.frame = CGRectMake(96.0,90.0,103.0, 42.0);
        [self addSubview:homeView];
        [homeView release];
        
        rotationView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@""]];
        rotationView.frame = CGRectMake(0.0, 0.0+ 148.0/2.0,296, 148);
        rotationView.backgroundColor = [UIColor clearColor];
        rotationView.userInteractionEnabled = YES;
        rotationView.layer.anchorPoint = CGPointMake(0.5,1.0);
        if (rotationViewIsNomal)
        {
            rotationView.layer.transform = CATransform3DIdentity;
        }
        else
        {
            rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(180),0.0, 0.0, 1.0);;
        }
        [self addSubview:rotationView];
        [rotationView release];
        
        for (int i = 0;i<7;i++)
        {
            NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
            
            UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
            button.frame = rect[i];
            if ([dic objectForKey:@"nomal"])
            {
                [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
            }
            if ([dic objectForKey:@"high"])
            {
                [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlStateHighlighted];
            }
            [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
            button.tag = (12+i);
            button.showsTouchWhenHighlighted = YES;
            if (i!=6)
            {
                [rotationView addSubview:button];
            }
        }
        
        for (int i = 7;i < 12 ;i++ )
         {
             NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
         
             UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
             button.frame = rect[i];
             if ([dic objectForKey:@"nomal"])
             {
                 [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
             }
             if ([dic objectForKey:@"high"])
             {
                 [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlEventTouchUpInside];
             }
             [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
             button.tag = i;
             button.showsTouchWhenHighlighted = YES;
             [self  addSubview:button];
         }

    }
    else if ([self.Moduleid isEqualToString:@"002"])//保险服务模块
    {
        [arrayButtonIcon removeAllObjects];
        
        rect[0] =  CGRectMake(247,83,40,40);
        NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Ins_06.png",@"nomal",
                             @"Ins_06.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[1] =  CGRectMake(213,40,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Ins_05.png",@"nomal",
               @"Ins_05.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[2] =  CGRectMake(164,11,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"电话投保.png",@"nomal",
               @"电话投保.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[3] =  CGRectMake(100,11,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Ins_03.png",@"nomal",
               @"Ins_03.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[4] =  CGRectMake(48,40,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Ins_02.png",@"nomal",
               @"Ins_02.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[5] =  CGRectMake(12,83,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Ins_01.png",@"nomal",
               @"Ins_01.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[6] =  CGRectMake(10,93,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"优惠信息.png",@"nomal",
               @"优惠信息.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        //////////////////////////////////////////////////////////////////////////////
        
        rect[7] =  CGRectMake(207,103,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_05.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[8] =  CGRectMake(88,70,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_2.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[9] =  CGRectMake(182,70,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_04.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[10] =  CGRectMake(63,103,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_01.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        ///////////////////////////////////////////////////////////////////////////////
        rect[11] =  CGRectMake(135,55,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_03.png",@"nomal",
               @"22a.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        if([self.subviews count] > 0)
        {
            for (UIView *subview in self.subviews) 
            {
                [subview removeFromSuperview];
            }
        }
        
        bgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"menu1.png"]];
        bgView.frame = CGRectMake(53.0,49.0,191.0, 86.0);
        [self addSubview:bgView];
        [bgView release];
        
        homeView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"cpic.png"]];
        homeView.frame = CGRectMake(96.0,90.0,103.0, 42.0);
        [self addSubview:homeView];
        [homeView release];
        
        rotationView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@""]];
        rotationView.frame = CGRectMake(0.0, 0.0+ 148.0/2.0,296, 148);
        rotationView.backgroundColor = [UIColor clearColor];
        rotationView.userInteractionEnabled = YES;
        rotationView.layer.anchorPoint = CGPointMake(0.5,1.0);
        if (rotationViewIsNomal)
        {
            rotationView.layer.transform = CATransform3DIdentity;
        }
        else
        {
            rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(180),0.0, 0.0, 1.0);;
        }
        [self addSubview:rotationView];
        [rotationView release];
        
        for (int i = 0;i<7;i++)
        {
            NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
            
            UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
            button.frame = rect[i];
            if ([dic objectForKey:@"nomal"])
            {
                [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
            }
            if ([dic objectForKey:@"high"])
            {
                [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlStateHighlighted];
            }
            [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
            button.tag = (24+i);
            button.showsTouchWhenHighlighted = YES;
            if (i!=6)
            {
                [rotationView addSubview:button];
            }
        }
        
        for (int i = 7;i < 12 ;i++ )
         {
             NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
             UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
             button.frame = rect[i];
             if ([dic objectForKey:@"nomal"])
             {
                 [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
             }
             if ([dic objectForKey:@"high"])
             {
                 [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlEventTouchUpInside];
             }
             [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
             button.tag = i;
             button.showsTouchWhenHighlighted = YES;
             [self  addSubview:button];
         }
        
    }
    else if ([self.Moduleid isEqualToString:@"003"])//系统设置模块
    {
        [arrayButtonIcon removeAllObjects];
        
        rect[5] =  CGRectMake(247,93,40,40);
        NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Sys_01.png",@"nomal",
                             @"Sys_01.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[1] =  CGRectMake(223,48,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Sys_05.png",@"nomal",
               @"Sys_05.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[2] =  CGRectMake(184,17,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Sys_04.png",@"nomal",
               @"Sys_04.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[3] =  CGRectMake(130,3,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Sys_03.png",@"nomal",
               @"Sys_03.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[4] =  CGRectMake(72,17,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Sys_02.png",@"nomal",
               @"Sys_02.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[0] =  CGRectMake(32,48,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Sys_01.png",@"nomal",
               @"Sys_01.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[6] =  CGRectMake(10,93,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"优惠信息.png",@"nomal",
               @"优惠信息.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        //////////////////////////////////////////////////////////////////////////////
        
        rect[7] =  CGRectMake(207,103,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_05.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[8] =  CGRectMake(88,70,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_02.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[9] =  CGRectMake(182,70,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_4.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[10] =  CGRectMake(63,103,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_01.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        ///////////////////////////////////////////////////////////////////////////////
        rect[11] =  CGRectMake(135,55,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_03.png",@"nomal",
               @"22a.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        if([self.subviews count] > 0)
        {
            for (UIView *subview in self.subviews) 
            {
                [subview removeFromSuperview];
            }
        }
        
        bgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"menu1.png"]];
        bgView.frame = CGRectMake(53.0,49.0,191.0, 86.0);
        [self addSubview:bgView];
        [bgView release];
        
        homeView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"cpic.png"]];
        homeView.frame = CGRectMake(96.0,90.0,103.0, 42.0);
        [self addSubview:homeView];
        [homeView release];
        
        rotationView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@""]];
        rotationView.frame = CGRectMake(0.0, 0.0+ 148.0/2.0,296, 148);
        rotationView.backgroundColor = [UIColor clearColor];
        rotationView.userInteractionEnabled = YES;
        rotationView.layer.anchorPoint = CGPointMake(0.5,1.0);
        if (rotationViewIsNomal)
        {
            rotationView.layer.transform = CATransform3DIdentity;
        }
        else
        {
            rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(180),0.0, 0.0, 1.0);;
        }
        [self addSubview:rotationView];
        [rotationView release];
        
        for (int i = 0;i<7;i++)
        {
            NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
            
            UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
            button.frame = rect[i];
            if ([dic objectForKey:@"nomal"])
            {
                [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
            }
            if ([dic objectForKey:@"high"])
            {
                [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlStateHighlighted];
            }
            [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
            button.tag = (36+i);
            button.showsTouchWhenHighlighted = YES;
            if (i==0 || i==1|| i==2|| i==3|| i==4 ) 
            {
                [rotationView  addSubview:button];
            }
        }
        
        for (int i = 7;i < 12 ;i++ )
         {
             NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
             
             UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
             button.frame = rect[i];
             if ([dic objectForKey:@"nomal"])
             {
                 [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
             }
             if ([dic objectForKey:@"high"])
             {
                 [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlEventTouchUpInside];
             }
             [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
             button.tag = i;
             button.showsTouchWhenHighlighted = YES;
             [self  addSubview:button];
         }
        
    }
    else if ([self.Moduleid isEqualToString:@"004"])//客户服务模块
    {
        [arrayButtonIcon removeAllObjects];
        
        rect[0] =  CGRectMake(247,93,40,40);
        NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Cus_02.png",@"nomal",
                             @"Cus_02.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[1] =  CGRectMake(223,48,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Cus_01.png",@"nomal",
               @"Cus_01.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[2] =  CGRectMake(184,17,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"服务评价.png",@"nomal",
               @"服务评价.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[3] =  CGRectMake(130,3,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"服务预约.png",@"nomal",
               @"服务预约.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[4] =  CGRectMake(72,17,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"联系客服.png",@"nomal",
               @"联系客服.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[5] =  CGRectMake(32,48,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"优惠信息.png",@"nomal",
               @"优惠信息.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[6] =  CGRectMake(10,93,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"公司介绍.png",@"nomal",
               @"公司介绍.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        //////////////////////////////////////////////////////////////////////////////
        
        rect[7] =  CGRectMake(207,103,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_05.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[8] =  CGRectMake(88,70,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_02.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[9] =  CGRectMake(182,70,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_04.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[10] =  CGRectMake(63,103,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_1.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        ///////////////////////////////////////////////////////////////////////////////
        rect[11] =  CGRectMake(135,55,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_03.png",@"nomal",
               @"22a.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        if([self.subviews count] > 0)
        {
            for (UIView *subview in self.subviews) 
            {
                [subview removeFromSuperview];
            }
        }
        
        bgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"menu1.png"]];
        bgView.frame = CGRectMake(53.0,49.0,191.0, 86.0);
        [self addSubview:bgView];
        [bgView release];
        
        homeView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"cpic.png"]];
        homeView.frame = CGRectMake(96.0,90.0,103.0, 42.0);
        [self addSubview:homeView];
        [homeView release];
        
        rotationView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@""]];
        rotationView.frame = CGRectMake(0.0, 0.0+ 148.0/2.0,296, 148);
        rotationView.backgroundColor = [UIColor clearColor];
        rotationView.userInteractionEnabled = YES;
        rotationView.layer.anchorPoint = CGPointMake(0.5,1.0);
        if (rotationViewIsNomal)
        {
            rotationView.layer.transform = CATransform3DIdentity;
        }
        else
        {
            rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(180),0.0, 0.0, 1.0);;
        }
        [self addSubview:rotationView];
        [rotationView release];
        
        for (int i = 0;i<7;i++)
        {
            NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
            
            UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
            button.frame = rect[i];
            if ([dic objectForKey:@"nomal"])
            {
                [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
            }
            if ([dic objectForKey:@"high"])
            {
                [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlStateHighlighted];
            }
            [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
            button.tag = (48+i);
            button.showsTouchWhenHighlighted = YES;
            [rotationView  addSubview:button];
        }
        
        for (int i = 7;i < 12 ;i++ )
         {
             NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
             
             UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
             button.frame = rect[i];
             if ([dic objectForKey:@"nomal"])
             {
                 [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
             }
             if ([dic objectForKey:@"high"])
             {
                 [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlEventTouchUpInside];
             }
             [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
             button.tag = i;
             button.showsTouchWhenHighlighted = YES;
             [self  addSubview:button];
         }
        
    }
    else if ([self.Moduleid isEqualToString:@"005"])//增值服务模块
    {
        [arrayButtonIcon removeAllObjects];
        
        rect[0] =  CGRectMake(247,83,40,40);
        NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Val_07.png",@"nomal",
                             @"Val_07.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[1] =  CGRectMake(223,48,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Val_06.png",@"nomal",
               @"Val_06.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[2] =  CGRectMake(213,40,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Val_05.png",@"nomal",
               @"Val_05.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[3] =  CGRectMake(164,11,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Val_04.png",@"nomal",
               @"Val_04.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[4] =  CGRectMake(100,11,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Val_03.png",@"nomal",
               @"Val_03.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[5] =  CGRectMake(48,40,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Val_02.png",@"nomal",
               @"Val_02.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[6] =  CGRectMake(12,83,40,40);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Val_01.png",@"nomal",
               @"Val_01.png",@"high",nil];
        [arrayButtonIcon addObject:dic];
        
        //////////////////////////////////////////////////////////////////////////////
        
        rect[7] =  CGRectMake(207,103,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_05.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[8] =  CGRectMake(88,70,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_02.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[9] =  CGRectMake(182,70,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_04.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        rect[10] =  CGRectMake(63,103,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_01.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        ///////////////////////////////////////////////////////////////////////////////
        rect[11] =  CGRectMake(135,55,25,25);
        dic = [NSDictionary dictionaryWithObjectsAndKeys:@"Icon_3.png",@"nomal",nil];
        [arrayButtonIcon addObject:dic];
        
        if([self.subviews count] > 0)
        {
            for (UIView *subview in self.subviews) 
            {
                [subview removeFromSuperview];
            }
        }
        
        bgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"menu1.png"]];
        bgView.frame = CGRectMake(53.0,49.0,191.0, 86.0);
        [self addSubview:bgView];
        [bgView release];
        
        homeView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"cpic.png"]];
        homeView.frame = CGRectMake(96.0,90.0,103.0, 42.0);
        [self addSubview:homeView];
        [homeView release];
        
        rotationView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@""]];
        rotationView.frame = CGRectMake(0.0, 0.0+ 148.0/2.0,296, 148);
        rotationView.backgroundColor = [UIColor clearColor];
        rotationView.userInteractionEnabled = YES;
        rotationView.layer.anchorPoint = CGPointMake(0.5,1.0);
        if (rotationViewIsNomal)
        {
            rotationView.layer.transform = CATransform3DIdentity;
        }
        else
        {
            rotationView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(180),0.0, 0.0, 1.0);;
        }
        [self addSubview:rotationView];
        [rotationView release];
        
        for (int i = 0;i<7;i++)
        {
            NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
            
            UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
            button.frame = rect[i];
            if ([dic objectForKey:@"nomal"])
            {
                [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
            }
            if ([dic objectForKey:@"high"])
            {
                [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlStateHighlighted];
            }
            [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
            button.tag = (60+i);
            button.showsTouchWhenHighlighted = YES;
            if (i!=1)
            {
                [rotationView addSubview:button];
            }
        }
        
        for (int i = 7;i < 12 ;i++ )
        {
            NSDictionary *dic = [arrayButtonIcon objectAtIndex:i];
            
            UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
            button.frame = rect[i];
            if ([dic objectForKey:@"nomal"])
            {
                [button setImage:[UIImage imageNamed:[dic objectForKey:@"nomal"]] forState:UIControlStateNormal];
            }
            if ([dic objectForKey:@"high"])
            {
                [button setImage:[UIImage imageNamed:[dic objectForKey:@"high"]] forState:UIControlEventTouchUpInside];
            }
            [button addTarget:self action:@selector(meunButtonDown:) forControlEvents:UIControlEventTouchUpInside];
            button.tag = i;
            button.showsTouchWhenHighlighted = YES;
            [self  addSubview:button];
        }
    }
}

-(void)SETCustomerQueryRequest;//向太保移动平台发送客户资料查询请求报文
{
    NSDictionary *dictUserInfo=[[NSUserDefaults standardUserDefaults] dictionaryForKey:DICT_USER_INFO];
    if (dictUserInfo!=nil) 
    {
        if ([dictUserInfo valueForKey:@"UserAccount"]) 
        {
            NSLog(@"%@",[dictUserInfo valueForKey:@"UserAccount"]);
        }
    }
    else
    {
        [self justShowMessage:@"用户还没登录,请登录系统" title:@"注意"];
        return;
    }
    
//    NSString *strRequestCode=@"RequestCode=62201";
    NSString *strRequestData=[NSString stringWithFormat:@"{\"userAccount\":\"%@\"}",[dictUserInfo valueForKey:@"UserAccount"]];
//    NSString *strUrl=[NSString stringWithFormat:@"%@%@%@",Server_Url,strRequestCode,strRequestData];
//    NSLog(@"++++++++++++++%@",strUrl);
//    strUrl = [strUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];//字符串编码转换
//    NSURL *myurl = [NSURL URLWithString:strUrl];//This method expects URLString to contain any necessary percent escape codes, which are ‘:’, ‘/’, ‘%’, ‘#’, ‘;’, and ‘@’. Note that ‘%’ escapes are translated via UTF-8.
//    NSLog(@"URL:%@",myurl);
    ASIFormDataRequest *request = [[ASIFormDataRequest alloc] initWithURL:[NSURL URLWithString:Server_Url_Form]];
    //设置需要POST的数据，这里提交两个数据，A=a&B=b
    [request setPostValue:@"62201" forKey:@"RequestCode"];
    [request setPostValue:strRequestData forKey:@"RequestData"];
    
    [request setDelegate:self];
    [request setDidFailSelector:@selector(ResponseFail1:)];
    [request setDidFinishSelector:@selector(ResonseSuccess1:)];
    [request startAsynchronous];
}

- (void)ResonseSuccess1:(ASIHTTPRequest *)request
{
    NSLog(@"userinfodefault%@",[[NSUserDefaults standardUserDefaults] objectForKey:DICT_USER_INFO]);
    NSDictionary *dictUserInfo=[[NSUserDefaults standardUserDefaults] dictionaryForKey:DICT_USER_INFO];
    if (dictUserInfo!=nil) 
    {
        if ([dictUserInfo valueForKey:@"UserAccount"]) {
            NSLog(@"%@",[dictUserInfo valueForKey:@"UserAccount"]);
        }
    }
    else
    {
    }

    NSString *responseString = [request responseString];
    NSLog(@"responseString------%@",responseString);
    NSMutableDictionary *dictResponse=[responseString JSONValue];
    NSMutableDictionary *jsonoSubObj = [dictResponse objectForKey:@"head"];
    NSString * ss = [[NSString alloc] initWithFormat:@"%@",[jsonoSubObj objectForKey:@"success"]];
    
    if ([ss isEqualToString:@"1"])
    {
        NSString *IDNum = [dictResponse objectForKey:@"idNo"];
        NSString *CarNum = [dictResponse objectForKey:@"license"];
        NSString *ContactPhone = [dictResponse objectForKey:@"contactPhone"];
        NSString *Email = [dictResponse objectForKey:@"email"];
        NSString *Address = [dictResponse objectForKey:@"postalAddress"];
        
        NSLog(@"-------------%@",IDNum);
        
        NSDictionary *dictCustomerInfo=[[NSDictionary alloc]initWithObjectsAndKeys:[dictUserInfo valueForKey:@"UserName"],@"userName",IDNum,@"idNo",CarNum,@"license",ContactPhone,@"phone",Email,@"email",Address,@"postalAddress", nil];
        NSUserDefaults *myDefaults=[NSUserDefaults standardUserDefaults];
        [myDefaults setObject:dictCustomerInfo forKey:DICT_CUSTOMER_INFO];
        
        NSDictionary * DictCustomerInfo =[[NSUserDefaults standardUserDefaults] dictionaryForKey:DICT_CUSTOMER_INFO];
        if (DictCustomerInfo!=nil) 
        {
            if([Flag isEqualToString:@"0"])
            {
                NSString * alertinfo = [NSString stringWithFormat:@"请确认您的资料信息:名称%@,手机号码%@,联系地址%@",[DictCustomerInfo valueForKey:@"userName"],[DictCustomerInfo valueForKey:@"phone"],[DictCustomerInfo valueForKey:@"postalAddress"]];
            
                UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:alertinfo delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:@"取消",nil];
                [alertView show];
                alertView.delegate = self;
                [alertView release];
            }
            
            if ([DictCustomerInfo valueForKey:@"userName"])
            {
                NSLog(@"%@",[DictCustomerInfo valueForKey:@"userName"]);
            }
            else 
            {
                [self justShowMessage:@"请到客户资料管理填写客户名称!" title:@"提示"];
            }
            
            if ([DictCustomerInfo valueForKey:@"phone"])
            {
                NSLog(@"%@",[DictCustomerInfo valueForKey:@"phone"]);
            }
            else 
            {
                [self justShowMessage:@"请到客户资料管理填写手机号码!" title:@"提示"];
            }
            
            if ([DictCustomerInfo valueForKey:@"postalAddress"])
            {
                NSLog(@"%@",[DictCustomerInfo valueForKey:@"postalAddress"]);
            }
            else 
            {
                [self justShowMessage:@"请到客户资料管理填写联系地址!" title:@"提示"];
            }
        }
        else
        {
            [self justShowMessage:@"用户还没补充完整客户名称、手机号码、联系地址!" title:@"注意"];
            return;
        }
    }
    else
    {
        [self justShowMessage:@"获取客户资料信息失败！" title:@"提示"];
        return;
    }
}

- (void)ResponseFail1:(ASIHTTPRequest *)request
{
    NSLog(@"服务器连接失败!");
    [self justShowMessage:@"服务器连接失败！" title:@"提示"];
}

- (void)alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)buttonIndex
{
    NSLog(@"------------%d",alert.tag);
    
    switch(alert.tag)
    {
        case 0:
            if (buttonIndex == [alert cancelButtonIndex])
                //默认cancelButtonIndex = 0，每个按钮index可设
            {
                SeckillAreaView = [[SeckillAreaViewController alloc]init];
                [[AppDelegate app].unc pushViewController:SeckillAreaView animated:YES];
                [SeckillAreaView release];
            }
            break;
        default:
            break;
    }
}


@end
